package basis.game.Camera;

import basis.game.level.Terrain;
import basis.game.main.Renderable;

public class Camera{
    
    double x,y,w,h,zoom=1;
    
    public Camera(double x,double y,double w,double h){
        this.x=x;this.y=y;this.w=w;this.h=h;
    }
    
    public void update(Renderable l){
        l.setX(x);
        l.setY(y);
    }
    
    public void setZoom(double z){
        zoom=z;
    }
    
    public void move(double x,double y){
        this.x+=x;
        this.y+=y;
    }
    
    public void setX(double x){
        this.x=x;
    }
    
    public void setY(double y){
        this.y=y;
    }
    
    public double getCenterX(){
        return x+w/2;
    }
    
    public double getCenterY(){
        return y+h/2;
    }
    
    public void setCenterX(double x){
        this.x=x-w/2;
    }
    
    public void setCenterY(double y){
        this.y=y-h/2;
    }
    
}